package com.xxl.job.admin.core.alarm.impl;

import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.kim.dingding.robotsend.Robot;
import com.xxl.job.admin.core.alarm.JobAlarm;
import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.model.XxlJobLog;
import io.micrometer.core.instrument.util.JsonUtils;
import org.springframework.stereotype.Component;

/**
 * @author KimWu
 * @date 2020/6/16 9:49
 * @Description ：
 */
@Component
public class DingdingAlarm implements JobAlarm {

    @Override
    public boolean doAlarm(XxlJobInfo info, XxlJobLog jobLog) {
        System.out.println(" phone Alaram is starting ...... ");
        System.out.println("info.toString() = " + info.toString());
        System.out.println("jobLog.toString() = " + jobLog.toString());
        Robot.robotSend(
                JSONObject.toJSONString(info) + " <<<<<<<>>>>>>>" + JSONObject.toJSONString(jobLog)
        );
        return false;
    }
}
